package com.cn.wanxi.dao;

import com.cn.wanxi.model.NewsModel;

import java.util.List;
import java.util.Map;

public interface INewsDao {
    /**
     * 后台
     * @param newsModel
     * @return
     */
    int addNews(NewsModel newsModel);

    int deleteNews(int id);

    int editNews(NewsModel newsModel);

    NewsModel getNews(int id);

    List<NewsModel> getAllNews(Map<String, Object> map);

    long getNewsCount(Map<String, Object> map);

    int updateShow(NewsModel news);

    List<NewsModel> getNewsListByRedis();

    void setNewsListInRedis(List<NewsModel> newsList);

    /**
     * 前台分页展示
     * @return
     * @param map
     */
    List<NewsModel> getNewsList(Map<String, Object> map);

    long getNewsListCount(Map<String,Object> map);
}
